import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/hero_tag.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/checkpoint/user_card.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class CheckpointPrepareGameTopHeadWidget extends StatelessWidget {
  final CardList info;
  const CheckpointPrepareGameTopHeadWidget({Key key, this.info})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Hero(
      tag: HeroTag.GAME_HEAD,
      child: Container(
        width: setRatio(80),
        height: setRatio(80),
        margin: EdgeInsets.only(top: setRatio(15)),
        decoration: BoxDecoration(
            image:
                DecorationImage(image: NetworkImage(info?.card?.picUrlSmall ?? ''))),
        child: Stack(
          overflow: Overflow.visible,
          children: <Widget>[
            Positioned(
              bottom: 0,
              right: 0,
              child: Container(
                width: setRatio(34),
                height: setRatio(15),
                decoration: BoxDecoration(
                    color: Color(0xbF000000),
                    borderRadius: BorderRadius.only(
                        topLeft: Radius.circular(setRatio(3)),
                        bottomRight: Radius.circular(setRatio(3)))),
                child: Center(
                  child: Text.rich(
                    TextSpan(
                        style: TextStyle(
                            color: Color(0xFFFFFFFF),
                            fontFamily: FontFamily.PMZD,
                            fontSize: setTextSp(9)),
                        children: [
                          TextSpan(text: 'Lv.'),
                          TextSpan(
                              text: '${info?.cardLevel?.level ?? 0}',
                              style: TextStyle(fontSize: setTextSp(11)))
                        ]),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
